package com.stadium.web.repository;

import com.stadium.web.domain.User;
import java.util.List;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.transaction.annotation.Transactional;
/**
 * 用户Repository接口
 * 
 * @author ruoyi
 * @date 2020-03-14
 */
public interface UserRepository extends JpaRepository<User, Long>
{
//
//    /**
//     * 查询用户
//     *
//     * @param id 用户ID
//     * @return 用户
//     */
//    public User findByIdAndStatus(Long id, Byte status);


    @Modifying
    @Transactional
    @Query("update #{#entityName} set delflag = ?1  where partyid in ?2")
    Integer updateStatusByIdIn(Byte code, List<Long> ids);

    @Transactional
    User findByPhoneAndPassword(String username, String password);

    User findByPhone(String phone);
}
